import { request } from '@/request'

export const addRescue = <T extends object, R = any>(
  data: T
): Promise<IResponse<R>> => {
  return request.POST<T>({ url: '/app/rescue-info/add', params: data })
}

export const getRescueList = <T extends object, R = any>(
  params: T
): Promise<IResponse<IResponseList<R>>> => {
  return request.GET<T>({
    url: '/app/rescue-info/list',
    params
  })
}

// 新增救助记录
export const addRescueRecord = <T extends object, R = any>(
  data: T
): Promise<IResponse<R>> => {
  return request.POST<T>({ url: '/app/rescue-info/record/add', params: data })
}

// 获取救助记录
export const getRescueRecordList = <T extends object, R = any>(
  params: T
): Promise<IResponse<IResponseList<R>>> => {
  return request.GET<T>({
    url: '/app/rescue-info/record/info',
    params
  })
}
